package cn.lizemin.service.impl;

import cn.lizemin.dao.EmployDao;
import cn.lizemin.entity.Employee;
import cn.lizemin.entity.User;
import cn.lizemin.service.EmployeeService;
import cn.lizemin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author lzm
 * @version 1.0
 * @description: TODO
 * @date 2022/1/2 22:28
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class EmployeeServiceImpl implements EmployeeService {
    private EmployDao employDao;

    @Autowired
    public EmployeeServiceImpl(EmployDao employDao) {
        this.employDao = employDao;
    }

    @Override
    public List<Employee> list() {

        return this.employDao.list();
    }

    @Override
    public void addEmployee(Employee employee) {
        employDao.addEmployee(employee);
    }

    @Override
    public Employee findEmployeeById(Integer id) {
        return employDao.findEmployeeById(id);
    }

    @Override
    public void update(Employee employee) {
        employDao.update(employee);
    }

    @Override
    public void delete(Integer id) {
        employDao.delete(id);
    }
}
